export default {

  cTemp2fTemp(cTemp){
    return ((parseFloat(cTemp) * 9) / 5 + 32).toFixed(2);
  },
  cloneObj(obj) {
    var newObj = obj.constructor === Array ? []:{};
    newObj.constructor = obj.constructor;
    if(typeof obj !== "object"){
      return ;
    } else if(window.JSON){
      newObj = JSON.parse(JSON.stringify(obj));//若需要考虑特殊的数据类型，如正则，函数等，需把这个else if去掉即可
    } else {
      for(var prop in obj){
        if(obj[prop].constructor === RegExp ||obj[prop].constructor === Date){
          newObj[prop] = obj[prop];
        } else if(typeof obj[prop] === "object"){
          newObj[prop] = deepCopy(obj[prop]);//递归
        } else {
          newObj[prop] = obj[prop];
        }
      }
    }
    return newObj;
  },
  extendObj(){
    if(arguments.length < 1){return 0;}
    var tempobj = this.cloneObj(arguments[0]); //调用复制对象cloneObj方法
    for(var n = 1;n < arguments.length;n++){
      for(var key in arguments[n]){
        tempobj[key] = arguments[n][key];
      }
    }
    return tempobj;
  },
  markdown2html(doc){
    let markDownIt = require("markdown-it");
    let md = new markDownIt();
    return md.render(doc);
  },


};
